Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

Q is empty.

We use [23] with the following order to prove termination.

Recursive path order with status [2].
Quasi-Precedence:
merge2 > [.2, if3, <2]
nil > [.2, if3, <2]
++2 > [.2, if3, <2]
true > [.2, if3, <2]
false > [.2, if3, <2]

Status:
true: multiset
<2: [2,1]
++2: [2,1]
if3: [3,2,1]
false: multiset
merge2: multiset
.2: [2,1]
nil: multiset